<div id="compliance" class="tab-body">
  {{#if _hasBadData}}
    <div class="alert alert-danger post-action-notification" role="alert">
      <p>
        Oops! We have discovered some issues with this Dataset's fields that
        may put any updates in an invalid state. <br/>
        Unfortunately updates are <strong>disabled</strong> at this time. <br/>
        Please shoot us an email at
        <a href="mailto:ask_metadata@linkedin.com">ask_metadata@linkedin.com</a>
        and we will get on this asap! <br/>
        Our apologies.
      </p>
    </div>
  {{else}}
    <section class="action-bar">
      {{#if isEditing}}

        {{#if _message}}
          <div class="alert alert-{{_alertType}} post-action-notification action-footer-notification" role="alert">
            {{_message}}
          </div>
        {{/if}}

        <div class="container action-bar__content">
          {{#if isShowingComplianceEditMode}}
            <button
              class="nacho-button nacho-button--large-inverse action-bar__item"
              title="Next"
              {{action "onEditDatasetClassification"}}>
              Next
            </button>
          {{/if}}

          {{#if isShowingDatasetClassificationEditMode}}

            <button
              class="nacho-button nacho-button--large-inverse action-bar__item"
              title={{unless isDatasetFullyClassified
                             "Ensure you have provided a yes/no value for all dataset tags"
                             "Save"}}
                disabled={{isSavingDisabled}}
              {{action "saveCompliance"}}>
              Save
            </button>

            <button
              class="nacho-button--large nacho-button--secondary action-bar__item"
              title="Back"
              {{action "onEditCompliancePolicy"}}>
              Back
            </button>

          {{/if}}
        </div>

      {{/if}}
    </section>
  {{/if}}

  <div class="secondary-actions">
    <div class="policy-last-saved">
      Last saved:
      <span class="policy-last-saved__saved">
        {{if isNewComplianceInfo 'Never'
             (moment-from-now policyModificationTimeInEpoch)}}
      </span>
    </div>

    {{#unless isEditing}}

      <button
        {{action "onEditCompliancePolicy"}}
        class="nacho-button--large nacho-button--secondary secondary-actions__action">
        Edit
      </button>

      {{#unless isNewComplianceInfo}}
        <button
          {{action "onComplianceDownloadJson"}}
          class="nacho-button nacho-button--large-inverse secondary-actions__action">
          Download compliance metadata
        </button>
      {{/unless}}

    {{/unless}}
  </div>

  {{#if isEditing}}
    <div class="dataset-compliance-step-container">
      {{partial "datasets/dataset-compliance/-dataset-compliance-step-indicator"}}
    </div>
  {{/if}}

  {{#if (and isShowingComplianceEditMode (not _hasBadData))}}
    {{json-upload receiveJsonFile=(action "onComplianceJsonUpload") class="secondary-actions__action"}}
  {{/if}}

  {{#if (or isReadOnly isShowingDatasetClassificationEditMode)}}
    {{partial "datasets/dataset-compliance/dataset-classification"}}
  {{/if}}

  {{#if (or isReadOnly isShowingComplianceEditMode)}}
    {{partial "datasets/dataset-compliance/dataset-compliance-entities"}}
  {{/if}}
</div>

{{yield}}
